package com.jianganming.strategy.pay;

public class Order {
    private String uid;
    private double amount;

    public Order(String uid, double amount) {
        this.uid = uid;
        this.amount = amount;
    }

    public MsgResult pay(){
        return pay(PayEnum.AliPay);
    }

    public MsgResult pay(PayEnum payEnum){
        Payment payment = payEnum.getPayment();
        System.out.println("欢迎使用" + payEnum.getName());
        System.out.println("本次交易金额为" + amount + "，开始扣款");
        return payment.pay(uid,amount);
    }
}
